package svc

import (
	"github.com/zeromicro/go-zero/rest"
	"github.com/zeromicro/go-zero/zrpc"
	"muke-network/api/internal/config"
	"muke-network/api/internal/middleware"
	"muke-network/srv/mukeclient"
)

type ServiceContext struct {
	Config    config.Config
	MukeSrv   mukeclient.Muke
	AuthToken rest.Middleware
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config:    c,
		MukeSrv:   mukeclient.NewMuke(zrpc.MustNewClient(c.MukeSrv)),
		AuthToken: middleware.NewAuthTokenMiddleware().Handle,
	}
}
